<?php
/**
 * Created by PhpStorm.
 * User: lijie
 * Date: 2018/10/5
 * Time: 16:09
 */
namespace app\reserve\validate;

use think\Validate;

class Onecardproduct extends Validate{

    protected $rule = [
        'id'                => ['require','number'],
        'name'              => ['require'],
        'topup'             => ['require','number'],
        'backmoney'         => ['require','number'],
        'description'       => ['require'],
        'pagenum'           => ['require','number'],
        'listNum'           => ['require','number'],
    ];

    protected $message = [
        'id'                => 'id不能为空',
        'name'              => 'name不能为空',
        'topup'             => 'topup参数错误',
        'backmoney'          => 'backmoney参数错误',
        'description'       => '描述不能为空',
        'pagenum'           => 'pagenum不能为空',
        'listNum'           => 'listNum不能为空',
    ];

    protected $scene = [
        // 添加一卡通产品
        'addOneProduct'     => ['name','topup','backmoney','description'],
        // 编辑一卡通产品
        'editOneProduct'    => ['id'],
        // 一卡通列表产品
        'selectOneProduct'  => ['pagenum','listNum'],
    ];
}